package com.sample.mapping;

import javax.persistence.Column;

public class Comment<T> extends AbstractMapping<T>{
	
	@Column(name="user_id")
	private T userId;
	
	@Column(name="post_id")
	private T postId;
    
	@Column(name="comment")
	private String comment;

	public T getUserId() {
		return userId;
	}

	public void setUserId(T userId) {
		this.userId = userId;
	}

	public T getPostId() {
		return postId;
	}

	public void setPostId(T postId) {
		this.postId = postId;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
	@Override
	public int hashCode() {
		return getId().hashCode();
	}

	public boolean equals(Comment<T> comment) {
		if (this.getId() != comment.getId()) {
			return false;
		}
		return this.getId().equals(comment.getId());
	}

}
